/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.benhan;

import control.benhan.BAXoaFull_Ctrl;
import gui.event.benhan.BAXoaFull_evt;

/**
 *
 * @author Admin
 */
public class BAXoa_Full extends javax.swing.JDialog {

    /**
     * Creates new form BAXoa
     */
    public BAXoa_Full(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(parent);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlDieuKienLietKe = new javax.swing.JPanel();
        lbMaHOSoBenhAn = new javax.swing.JLabel();
        txtMaHoSoBenhAn = new javax.swing.JTextField();
        lbSoLuongPhieuDieuTri = new javax.swing.JLabel();
        tstSoLuongPhieuDieuTri = new javax.swing.JTextField();
        lbTenBenh = new javax.swing.JLabel();
        txtTenBenh = new javax.swing.JTextField();
        btnLietKe = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        btnClose = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        btlHSBA = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Xoá Bệnh Án");

        pnlDieuKienLietKe.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Điều kiện liệt kê", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 204)));

        lbMaHOSoBenhAn.setText("Mã hồ sơ bệnh án");

        lbSoLuongPhieuDieuTri.setText("Số lượng phiếu điều trị");

        lbTenBenh.setText("Tên bệnh");

        btnLietKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/Filter-Standard-16.png"))); // NOI18N
        btnLietKe.setText("Liệt kê");
        btnLietKe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLietKeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlDieuKienLietKeLayout = new javax.swing.GroupLayout(pnlDieuKienLietKe);
        pnlDieuKienLietKe.setLayout(pnlDieuKienLietKeLayout);
        pnlDieuKienLietKeLayout.setHorizontalGroup(
            pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDieuKienLietKeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbMaHOSoBenhAn)
                    .addComponent(lbSoLuongPhieuDieuTri))
                .addGap(18, 18, 18)
                .addGroup(pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtMaHoSoBenhAn)
                    .addComponent(tstSoLuongPhieuDieuTri, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE))
                .addGroup(pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDieuKienLietKeLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnLietKe, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlDieuKienLietKeLayout.createSequentialGroup()
                        .addGap(78, 78, 78)
                        .addComponent(lbTenBenh, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(txtTenBenh, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 38, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlDieuKienLietKeLayout.setVerticalGroup(
            pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDieuKienLietKeLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbMaHOSoBenhAn)
                    .addComponent(txtMaHoSoBenhAn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbTenBenh)
                    .addComponent(txtTenBenh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlDieuKienLietKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbSoLuongPhieuDieuTri)
                    .addComponent(tstSoLuongPhieuDieuTri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDieuKienLietKeLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnLietKe)
                .addContainerGap())
        );

        btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/benhan/Book-Close-16 delete.png"))); // NOI18N
        btnDelete.setText("Xoá");
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });

        btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/Close-16.png"))); // NOI18N
        btnClose.setText("Đóng");
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        btlHSBA.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"BA001", "Dại", "10/05/2014", "20/05/2014", "Còn Bệnh", "Tiến Triển Tốt"},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Mã hồ sơ bệnh án", "Tên bệnh", "Ngày bắt đầu", "Ngày kết thúc", "Trạng thái", "Ghi chú"
            }
        ));
        btlHSBA.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                btlHSBAFocusGained(evt);
            }
        });
        jScrollPane1.setViewportView(btlHSBA);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlDieuKienLietKe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDieuKienLietKe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnDelete)
                    .addComponent(btnClose))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnLietKeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLietKeActionPerformed
        BAXoaFull_evt.btnLietKeActionPerformed();
        BAXoaFull_Ctrl.lietKeBATheoMaBA(txtMaHoSoBenhAn, btlHSBA);
        btlHSBA.resetKeyboardActions();
    }//GEN-LAST:event_btnLietKeActionPerformed

    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        BAXoaFull_evt.btnDeleteActionPerformed(btlHSBA);
    }//GEN-LAST:event_btnDeleteActionPerformed

    private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
       BAXoaFull_evt.btnCloseActionPerformed(this);
    }//GEN-LAST:event_btnCloseActionPerformed

    private void btlHSBAFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_btlHSBAFocusGained
       
    }//GEN-LAST:event_btlHSBAFocusGained

    /**
     * @param args the command line arguments
     */
    //    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(BAXoa_Full.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(BAXoa_Full.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(BAXoa_Full.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(BAXoa_Full.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the dialog */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                BAXoa_Full dialog = new BAXoa_Full(new javax.swing.JFrame(), true);
//                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
//                    @Override
//                    public void windowClosing(java.awt.event.WindowEvent e) {
//                        System.exit(0);
//                    }
//                });
//                dialog.setVisible(true);
//            }
//        });
//    }
   

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTable btlHSBA;
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnLietKe;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbMaHOSoBenhAn;
    private javax.swing.JLabel lbSoLuongPhieuDieuTri;
    private javax.swing.JLabel lbTenBenh;
    private javax.swing.JPanel pnlDieuKienLietKe;
    private javax.swing.JTextField tstSoLuongPhieuDieuTri;
    private javax.swing.JTextField txtMaHoSoBenhAn;
    private javax.swing.JTextField txtTenBenh;
    // End of variables declaration//GEN-END:variables
}
